<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>对象 实例</title>
</head>
<body>
    <script>
        
        {
            let utils = {
                version: '1.0.0',
                name: 'ws',
                getInfo () {
                    console.log('information');
                }
            }

            utils.name = 'tt';

            console.log(utils);
        }

        {
            class Utils {
                constructor (version,name) {
                    this.version = version;
                    this.name = name;
                }

                getInfo () {
                    console.log('information');
                }
            }

            let u = new Utils('2.0','wuzhao');

            console.log(u.name);
        }
        
    </script>
</body>
</html>